import request from '@/config/axios'

// 客户业务员 VO
export interface CustSalesmanVO {
  id: number // id
  custId: number // 客户ID
  userId: number // 业务员用户ID
  remark: string // 备注
}

// 客户业务员 API
export const CustSalesmanApi = {
  // 查询客户业务员分页
  getCustSalesmanPage: async (params: any) => {
    return await request.get({ url: `/business/cust-salesman/page`, params })
  },

  // 查询客户业务员详情
  getCustSalesman: async (id: number) => {
    return await request.get({ url: `/business/cust-salesman/get?id=` + id })
  },

  // 新增客户业务员
  createCustSalesman: async (data: CustSalesmanVO) => {
    return await request.post({ url: `/business/cust-salesman/create`, data })
  },

  // 修改客户业务员
  updateCustSalesman: async (data: CustSalesmanVO) => {
    return await request.put({ url: `/business/cust-salesman/update`, data })
  },

  // 删除客户业务员
  deleteCustSalesman: async (id: number) => {
    return await request.delete({ url: `/business/cust-salesman/delete?id=` + id })
  },

  // 导出客户业务员 Excel
  exportCustSalesman: async (params) => {
    return await request.download({ url: `/business/cust-salesman/export-excel`, params })
  },
}